﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace zhihu {
    public partial class FormSignUp : Form {
        public SignUpDialogResult SignUpMode { set; get; }

        public FormSignUp() {
            InitializeComponent();
            // 初始化选择模式默认值
            this.SignUpMode = SignUpDialogResult.Default;
        }

        private void btnWebSignUp_Click(object sender, EventArgs e) {
            // 网页登陆模式
            this.SignUpMode = SignUpDialogResult.WebSignUp;
            this.DialogResult = DialogResult.OK;
        }

        private void btnSetCookies_Click(object sender, EventArgs e) {
            // 设置COOKIES模式
            this.SignUpMode = SignUpDialogResult.SetCookies;
            this.DialogResult = DialogResult.OK;
        }
    }

    /// <summary>
    /// 选择登陆方式的返回值
    /// </summary>
    public enum SignUpDialogResult {
        /// <summary>
        /// 没选择模式
        /// </summary>
        Default = 0,
        /// <summary>
        /// 网页登陆
        /// </summary>
        WebSignUp = 1,
        /// <summary>
        /// 设置cookies登陆
        /// </summary>
        SetCookies = 2
    }
}
